<?php

namespace STAGE\StageBundle\Entity;

use Doctrine\ORM\Mapping as ORM;

/**
 * Stage
 *
 * @ORM\Table()
 * @ORM\Entity(repositoryClass="STAGE\StageBundle\Entity\StageRepository")
 */
class Stage {

    /**
     * @var integer
     *
     * @ORM\Column(name="id", type="integer")
     * @ORM\Id
     * @ORM\GeneratedValue(strategy="AUTO")
     */
    private $id;

    /**
     * @var string
     *
     * @ORM\Column(name="sujet", type="string", length=255)
     */
    private $sujet;

    /**
     * @var boolean
     *
     * @ORM\Column(name="statut", type="boolean",nullable=true)
     */
    private $statut;

    /**
     * @var \DateTime
     *
     * @ORM\Column(name="date_debut", type="date")
     */
    private $dateDebut;

    /**
     * @var \DateTime
     *
     * @ORM\Column(name="date_fin", type="date")
     */
    private $dateFin;

    /**
     * @var string
     *
     * @ORM\Column(name="description", type="text")
     */
    private $description;

    /**
     *
     * @ORM\ManyToMany(targetEntity="STAGE\UserBundle\Entity\User",mappedBy="stageEtudiant")
     */
    private $etudiants;

    /**
     *
     * @ORM\OneToMany(targetEntity="STAGE\StageBundle\Entity\StagePersonne",mappedBy="stage",cascade={"persist"})
     */
    private $enseignants;

    /**
     *
     * @ORM\OneToMany(targetEntity="STAGE\UserBundle\Entity\User",mappedBy="stageEncadreur")
     */
    private $encadreur;

    /**
     *
     * @ORM\ManyToOne(targetEntity="STAGE\StageBundle\Entity\TypeStage",inversedBy="stages")
     */
    private $type;

    /**
     *
     * @ORM\OneToMany(targetEntity="STAGE\StageBundle\Entity\Document",mappedBy="stage")
     */
    private $documents;

    /**
     *
     * @ORM\OneToMany(targetEntity="STAGE\StageBundle\Entity\Tache",mappedBy="stage")
     */
    private $taches;

    /**
     * Get id
     *
     * @return integer 
     */
    public function getId() {
        return $this->id;
    }

    /**
     * Set sujet
     *
     * @param string $sujet
     * @return Stage
     */
    public function setSujet($sujet) {
        $this->sujet = $sujet;

        return $this;
    }

    /**
     * Get sujet
     *
     * @return string 
     */
    public function getSujet() {
        return $this->sujet;
    }

    /**
     * Set dateDebut
     *
     * @param \DateTime $dateDebut
     * @return Stage
     */
    public function setDateDebut($dateDebut) {
        $this->dateDebut = $dateDebut;

        return $this;
    }

    /**
     * Get dateDebut
     *
     * @return \DateTime 
     */
    public function getDateDebut() {
        return $this->dateDebut;
    }

    /**
     * Set dateFin
     *
     * @param \DateTime $dateFin
     * @return Stage
     */
    public function setDateFin($dateFin) {
        $this->dateFin = $dateFin;

        return $this;
    }

    /**
     * Get dateFin
     *
     * @return \DateTime 
     */
    public function getDateFin() {
        return $this->dateFin;
    }

    /**
     * Set description
     *
     * @param string $description
     * @return Stage
     */
    public function setDescription($description) {
        $this->description = $description;

        return $this;
    }

    /**
     * Get description
     *
     * @return string 
     */
    public function getDescription() {
        return $this->description;
    }

    /**
     * Set statut
     *
     * @param boolean $statut
     * @return Stage
     */
    public function setStatut($statut) {
        $this->statut = $statut;

        return $this;
    }

    /**
     * Get statut
     *
     * @return boolean 
     */
    public function getStatut() {
        return $this->statut;
    }

    /**
     * Constructor
     */
    public function __construct() {
        $this->users = new \Doctrine\Common\Collections\ArrayCollection();
        $this->statut = false;
    }

    /**
     * Set type
     *
     * @param \STAGE\StageBundle\Entity\TypeStage $type
     * @return Stage
     */
    public function setType(\STAGE\StageBundle\Entity\TypeStage $type = null) {
        $this->type = $type;

        return $this;
    }

    /**
     * Get type
     *
     * @return \STAGE\StageBundle\Entity\TypeStage 
     */
    public function getType() {
        return $this->type;
    }

    /**
     * Add documents
     *
     * @param \STAGE\StageBundle\Entity\Document $documents
     * @return Stage
     */
    public function addDocument(\STAGE\StageBundle\Entity\Document $documents) {
        $this->documents[] = $documents;

        return $this;
    }

    /**
     * Remove documents
     *
     * @param \STAGE\StageBundle\Entity\Document $documents
     */
    public function removeDocument(\STAGE\StageBundle\Entity\Document $documents) {
        $this->documents->removeElement($documents);
    }

    /**
     * Get documents
     *
     * @return \Doctrine\Common\Collections\Collection 
     */
    public function getDocuments() {
        return $this->documents;
    }

    /**
     * Add taches
     *
     * @param \STAGE\StageBundle\Entity\Tache $taches
     * @return Stage
     */
    public function addTach(\STAGE\StageBundle\Entity\Tache $taches) {
        $this->taches[] = $taches;

        return $this;
    }

    /**
     * Remove taches
     *
     * @param \STAGE\StageBundle\Entity\Tache $taches
     */
    public function removeTach(\STAGE\StageBundle\Entity\Tache $taches) {
        $this->taches->removeElement($taches);
    }

    /**
     * Get taches
     *
     * @return \Doctrine\Common\Collections\Collection 
     */
    public function getTaches() {
        return $this->taches;
    }

    /**
     * Add etudiants
     *
     * @param \STAGE\UserBundle\Entity\User $etudiants
     * @return Stage
     */
    public function addEtudiant(\STAGE\UserBundle\Entity\User $etudiants) {
        $this->etudiants[] = $etudiants;
        $etudiants->addStageEtudiant($this);
        return $this;
    }

    /**
     * Remove etudiants
     *
     * @param \STAGE\UserBundle\Entity\User $etudiants
     */
    public function removeEtudiant(\STAGE\UserBundle\Entity\User $etudiants) {
        $this->etudiants->removeElement($etudiants);
    }

    /**
     * Get etudiants
     *
     * @return \Doctrine\Common\Collections\Collection 
     */
    public function getEtudiants() {
        return $this->etudiants;
    }

    /**
     * Add enseignants
     *
     * @param \STAGE\StageBundle\Entity\StagePersonne $enseignants
     * @return Stage
     */
    public function addEnseignant(\STAGE\StageBundle\Entity\StagePersonne $enseignants) {
        $this->enseignants[] = $enseignants;
        $enseignants->setStage($this);
        return $this;
    }

    /**
     * Remove enseignants
     *
     * @param \STAGE\StageBundle\Entity\StagePersonne $enseignants
     */
    public function removeEnseignant(\STAGE\StageBundle\Entity\StagePersonne $enseignants) {
        $this->enseignants->removeElement($enseignants);
    }

    /**
     * Get enseignants
     *
     * @return \Doctrine\Common\Collections\Collection 
     */
    public function getEnseignants() {
        return $this->enseignants;
    }

    /**
     * Set encadreur
     *
     * @param \STAGE\UserBundle\Entity\User $encadreur
     * @return Stage
     */
    public function setEncadreur(\STAGE\UserBundle\Entity\User $encadreur = null) {
        $this->encadreur = $encadreur;
        $encadreur->setStageEncadreur($this);
        return $this;
    }

    /**
     * Get encadreur
     *
     * @return \STAGE\UserBundle\Entity\User 
     */
    public function getEncadreur() {
        return $this->encadreur;
    }

}
